using System.Collections.Generic;
using System.Web.UI.WebControls.WebParts;
namespace Jaws.Core.Web.Controls.HtmlEditor
{
    public class Display : WebPart, IWebEditable
    {
        [WebBrowsable(true), Personalizable(true)]
        public string DisplayText { get; set; }

        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            writer.Write(DisplayText);
        }

        public Display()
        {
            DisplayText = "Hello World!";
        }

        #region IWebEditable Members

        EditorPartCollection IWebEditable.CreateEditorParts()
        {
            var editors = new List<EditorPart> { new Editor() };
            return new EditorPartCollection(editors);
        }

        object IWebEditable.WebBrowsableObject
        {
            get { return this; }
        }

        #endregion
    }
}